﻿using Microsoft.AspNetCore.Mvc;
using StarsAdmin.Application.User.Dtos;
using StarsAdmin.Core.BaseService;
using StarsAdmin.Core.DI;
using StarsAdmin.Core.Models;

namespace StarsAdmin.Application.User.Services
{
    public interface IUserService :
        IGetBaseService<UserDto>,
        IUpdateBaseService<AddUserInput, UpdateUserInput>,
        IExportOrImportService<AddUserInput>,
        IDeleteBaseService,
        IDependency
    {
        /// <summary>
        /// 根据名称获取数据
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<UserDto?> GetByNameAsync(string userName);

        /// <summary>
        /// 根据邮箱获取数据
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        Task<UserDto?> GetByEmailAsync(string email);

        /// <summary>
        /// 根据手机号码获取数据
        /// </summary>
        /// <param name="phoneNumber"></param>
        /// <returns></returns>
        Task<UserDto?> GetByPhoneNumberAsync(string phoneNumber);

        /// <summary>
        /// 分配权限
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> AssignPermissionsAsync(AssignPermissionsInput input);

        /// <summary>
        /// 启用
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> EnabledAsync(long id);

        /// <summary>
        /// 导出模版
        /// </summary>
        /// <returns></returns>
        Task<FileContentResult?> ExportTemplateAsync();

        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> PasswordResetAsync(PasswordResetInput input);

        /// <summary>
        /// 更新用户基本信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> UpdateUserInfoAsync(UpdateUserInfoInput input);

        /// <summary>
        /// 修改手机号
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> UpdatePhoneNumberAsync(UpdatePhoneNumberInput input);

        /// <summary>
        /// 修改邮箱
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> UpdateEmailAsync(UpdateEmailInput input);

        /// <summary>
        /// 修改头像
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> UpdateAvatarAsync(UpdateAvatarInput input);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> UpdatePasswordAsync(UpdatePasswordInput input);
    }
}